
//
//  Created by Filipe Caporali

#ifndef FFMacros_h
#define FFMacros_h
  

#define FF_BEGIN                     namespace FFrame {
#define FF_END                       }



#define PROPERTY_READONLY(varType, varName, varFuncName)\
protected: varType varName;\
public: varType get##varFuncName(void) const {return varName;}

#define PROPERTY_ASSIGN(varType, varName, varFuncName)\
protected: varType varName;\
public: varType get##varFuncName(void) const {return varName;}\
public: void set##varFuncName(varType p_value) {varName = p_value;}\

#define PROPERTY_ASSIGN_OBJECT(varType, varName, varFuncName)\
protected: varType varName;\
public: varType get##varFuncName(void) const {return varName;}\
public: void set##varFuncName(const varType &p_value) {varName = p_value;}\

//LOOP OPERATIONS

#define FOR_EACH_IN_VECTOR(varType, varName, vector)\
varType varName;\
for(unsigned long forEachCounter = 0;\
(forEachCounter < vector.count()) && (&(varName = vector[forEachCounter]) != NULL); \
forEachCounter++)

#define FOR_EACH_IN_VECTORP(varType, varName, vectorPointer)\
varType varName;\
for(unsigned long forEachCounter = 0;\
(forEachCounter < vectorPointer->count()) && ((varName = (varType)vectorPointer->itemAtIndex(forEachCounter)) != NULL); \
forEachCounter++)

#define FOR_EACH_IN_ARRAYP(varType, varName, arrayPointer)\
varType varName;\
for(unsigned long forEachCounter = 0;\
(forEachCounter < arrayPointer->count()) && ((varName = (varType)arrayPointer->objectAtIndex(forEachCounter)) != NULL); \
forEachCounter++)

#define FOR_EACH_IN_LIST(varType, varName, varlist)\
varType varName;\
for(unsigned long forEachCounter = 0;\
(forEachCounter < varlist.count()) && ((varName = (varType)varlist.itemAtIndex(forEachCounter)) != NULL); \
forEachCounter++)
//////////////////
#endif